home *** CD-ROM | disk | FTP | other *** search
/ Programming Microsoft Visual Basic .NET / Programming Microsoft Visual Basic .NET (Microsoft Press)(X08-78517)(2002).bin / setup / vbnet / 23 web forms and controls / databinding / dynamictemplateform.aspx < prev    next >
Encoding:
ASP.NET Web Form  |  2002-03-17  |  2.0 KB  |  47 lines

  1. <%@ Page Language="vb" AutoEventWireup="false" Codebehind="DynamicTemplateForm.aspx.vb" Inherits="DataBinding.DynamicTemplateForm" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3. <HTML>
  4.     <HEAD>
  5.         <title>DynamicTemplateForm</title>
  6.         <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
  7.         <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
  8.         <meta content="JavaScript" name="vs_defaultClientScript">
  9.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  10.     </HEAD>
  11.     <body>
  12.         <form id="Form1" method="post" runat="server">
  13.             <H1 style="FONT-WEIGHT: bold; FONT-SIZE: large">Dynamic Template Demo</H1>
  14.             <P style="FONT-WEIGHT: bold; FONT-SIZE: large"><FONT style="FONT-WEIGHT: normal" size="3">This 
  15.                     page demonstrates that you can load a template dynamically from an .ascx file 
  16.                     and that you can even create a custom template class that lets you be in full 
  17.                     control of how data is displayed in a Repeater, DataList, or DataGrid control.</FONT></P>
  18.             <P style="FONT-WEIGHT: bold; FONT-SIZE: large"><FONT size="3"></FONT> </P>
  19.             <P>Item Template:
  20.                 <asp:dropdownlist id="ddlItemTemplate" runat="server" Width="179px" AutoPostBack="True"></asp:dropdownlist>    
  21.                 Alternate Item Template
  22.                 <asp:dropdownlist id="ddlAlternateTemplate" runat="server" Width="179px" AutoPostBack="True"></asp:dropdownlist></P>
  23.             <P>
  24.                 <asp:Button id="btnCustom" runat="server" Width="122px" Text="Custom Template"></asp:Button></P>
  25.             <P><asp:datalist id="DataList1" runat="server" Width="604px">
  26.                     <ItemTemplate>
  27.                         <div>
  28.                             <b>
  29.                                 <%# Container.DataItem("Title") %>
  30.                             </b>-
  31.                             <%# Container.DataItem("price") %>
  32.                         </div>
  33.                     </ItemTemplate>
  34.                     <AlternatingItemTemplate>
  35.                         <div>
  36.                             <b>
  37.                                 <%# Container.DataItem("Title") %>
  38.                             </b>-
  39.                             <%# Container.DataItem("price") %>
  40.                         </div>
  41.                     </AlternatingItemTemplate>
  42.                 </asp:datalist></P>
  43.             <P> </P>
  44.         </form>
  45.     </body>
  46. </HTML>
  47.